package com.foreknow.demo3;

import java.util.Scanner;

/**
 * 嵌套if
 */
public class ControllDemo6 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入是否为会员:(y/n)");
        String idn = input.next();
        System.out.println("请输入金额:");
        double money = input.nextDouble();
        if (idn.equals("y")){
            //会员
            if(money > 2000){
                money = money*0.75;
            }else {
                money = money* 0.5;
            }
        }else {
            //非会员
            if (money>100) {{
                money = money* 0.9;
            }
            }

        }
        System.out.println("实际支付:" +money);
    }
}
